package com.woniuxy.carrental.mapper;

import com.woniuxy.carrental.entity.Details;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author author
 * @create 2021-10-06 13:21
 * 肖某的 仓库物品详情
 */
public interface DetailsMapper {
    //分页查询物品详情表单：动态sql：默认所有的物品详情表单 根据名称

    //新增数据
    void addDetails(Details details);
    //根据名称查询仓库数据
    @Select("select * from details where dename=#{dename}")
    Details selectByName(String dename);

    //根据名称修改数量
    void updataCountByName(@Param("decount")int decount,@Param("dename")String dename);

    //分页查询
    //分页查询仓库入库表中所有数据
    public List<Details> selectDetailsByPage(@Param("details")Details details, @Param("pageIndex") int pageIndex,
                                             @Param("pageSize") int pageSize);
    //分页查询数据条数
    public int selectCountDetailsByPage(@Param("details")Details details);

    //查询表中所有数据
    @Select("select * from details")
    List<Details> selectAllMapper();

    //根据id查询表中数据
    @Select("select * from details where deid=#{deid}")
    Details selectByIdOne(int deid);
}
